﻿using System;
using System.Xml.Serialization;

namespace TheDealmap.Data
{
    /// <summary>
    /// Represents the collections of deals returned from a search.
    /// </summary>
    [Serializable()]
    //[XmlTypeAttribute(AnonymousType = true, Namespace = "http://thedealmap.com/api")]
    [XmlRootAttribute(Namespace = "http://thedealmap.com/api", IsNullable = false)]
    public class Deals
    {
        /// <summary>
        /// Gets the message field.
        /// </summary>
        /// <value>The message field.</value>
        public string MessageField { get; set; }
        /// <summary>
        /// Gets the total results returned by a search
        /// </summary>
        /// <value>The total results.</value>
        public int TotalResults { get; set; }

        /// <summary>
        /// Gets the paged collection of results that match a search
        /// </summary>
        /// <value>The matched.</value>
        [XmlArray(ElementName = "Results")]
        [XmlArrayItem("Deal", typeof(Deal), IsNullable = false)]
        public Deal[] Matched { get; set; }
    }
}
